package com.ruoyi.web.gj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.web.gj.domain.WarningInfo;
import com.ruoyi.web.gj.mapper.WarningInfoMapper;
import com.ruoyi.web.gj.service.IWarningInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 告警数据Service业务层处理
 *
 * @author ruoyi
 * @date 2025-09-19
 */
@Service
public class WarningInfoServiceImpl implements IWarningInfoService
{
    @Autowired
    private WarningInfoMapper warningInfoMapper;

    /**
     * 查询告警数据
     *
     * @param id 告警数据主键
     * @return 告警数据
     */
    @Override
    public WarningInfo selectWarningInfoById(Long id)
    {
        return warningInfoMapper.selectWarningInfoById(id);
    }

    /**
     * 查询告警数据列表
     *
     * @param warningInfo 告警数据
     * @return 告警数据
     */
    @Override
    public List<WarningInfo> selectWarningInfoList(WarningInfo warningInfo)
    {
        return warningInfoMapper.selectWarningInfoList(warningInfo);
    }

    /**
     * 新增告警数据
     *
     * @param warningInfo 告警数据
     * @return 结果
     */
    @Override
    public int insertWarningInfo(WarningInfo warningInfo)
    {
        warningInfo.setCreateTime(DateUtils.getNowDate());
        return warningInfoMapper.insertWarningInfo(warningInfo);
    }

    /**
     * 修改告警数据
     *
     * @param warningInfo 告警数据
     * @return 结果
     */
    @Override
    public int updateWarningInfo(WarningInfo warningInfo)
    {
        warningInfo.setUpdateTime(DateUtils.getNowDate());
        return warningInfoMapper.updateWarningInfo(warningInfo);
    }

    /**
     * 批量删除告警数据
     *
     * @param ids 需要删除的告警数据主键
     * @return 结果
     */
    @Override
    public int deleteWarningInfoByIds(Long[] ids)
    {
        return warningInfoMapper.deleteWarningInfoByIds(ids);
    }

    /**
     * 删除告警数据信息
     *
     * @param id 告警数据主键
     * @return 结果
     */
    @Override
    public int deleteWarningInfoById(Long id)
    {
        return warningInfoMapper.deleteWarningInfoById(id);
    }
}
